import service from '@/utils/request'


//127.0.0.1:19090/system/course/info
export function getUserInfoService() {
    return service({
        url: "/course/info",
        method: "get",
    });
}

//127.0.0.1:19090/system/course/list
export function getCourseListService(params) {
    return service({
        url: "/course/list",
        method: "get",
        params
    });
}

export function getCourseDetailService(courseId) {
    return service({
        url: "/course/detail",
        method: "get",
        params: { courseId },
    });
}

export function addCourseService(params = {}) {
    return service({
        url: "/course/add",
        method: "post",
        data: params,
    });
}

export function delCourseService(courseId) {
    return service({
        url: "/course/delete",
        method: "delete",
        params: { courseId },
    });
}

export function editCourseService(params = {}) {
    return service({
        url: "/course/edit",
        method: "put",
        data: params,
    });
}

// 课程审核（通过/驳回）
export function reviewCourseService(courseId, status) {
    return service({
        url: "/course/review",
        method: "put",
        data: { 
            courseId, 
            status 
        }
    });
}